Skip to content

Conversation

@itslenny
Copy link
Contributor

@itslenny itslenny commented Nov 17, 2025

What kind of change does this PR introduce?

Bug fix

What is the current behavior?

Paths returned by TUS during multi-part uploads include a duplicate slash when adding the forwarded path prefix

Example: /storage/v1//upload/resumable/abc123

What is the new behavior?

Remove duplicate slash (/storage/v1/upload/resumable/abc123)

Additional context

Thanks for the report @aantti

@coveralls
Copy link

Pull Request Test Coverage Report for Build 19435467809

Details

  • 1 of 3 (33.33%) changed or added relevant lines in 1 file are covered.
  • 3 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.01%) to 75.911%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/http/routes/tus/lifecycle.ts 1 3 33.33%
Files with Coverage Reduction New Missed Lines %
src/http/routes/tus/lifecycle.ts 1 80.44%
src/internal/database/tenant.ts 2 83.65%
Totals Coverage Status
Change from base Build 19426789519: -0.01%
Covered Lines: 25386
Relevant Lines: 33165

💛 - Coveralls

const forwardedPath = req.headers['x-forwarded-prefix']
if (requestAllowXForwardedPrefix && typeof forwardedPath === 'string') {
basePath = forwardedPath + path
// Remove trailing slash from forwardedPath to avoid double slashes

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar pattern could happen for signV4 of canonical request if this feature requestAllowXForwardedPrefix is enabled or a configuration value ending with a slash is given. I believe, as a result, it can cause SignatureDoesNotMatch errors

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants